#ifndef EI_NETWORKMETHODES_H
#define EI_NETWORKMETHODES_H

namespace Ei {

class NetworkEvents
{
public:		
	NetworkEvents();
	~NetworkEvents();
//
//      Sensor data
//	
	void GetAccData(const WOscMessage *message);
	void GetMagData(const WOscMessage *message);
	void getHexamiteData(const WOscMessage *message);

	void DoFunctionThree(const WOscMessage *message);
	void DoFunctionFour(const WOscMessage *message);


///////// Object Functions //////////////////
	void setNodePosition(const WOscMessage *message);

	void setNodeOrientation(const WOscMessage *message);

	void setDollyPosition(const WOscMessage *message);

	void setDollyOrientation(const WOscMessage *message);


//////// Snack Functions ////////////////////////////
	void SnackBorn(const WOscMessage *message);
	void SnackEaten(const WOscMessage *message);

//////// Misc Functions ////////////////////////////
	void AddMethod(const WOscMessage *message);

private:
	// checks if the the message contains a string that's 
	// in the scene graph, and if it contains a number of variables,
	// default is three, 
	bool isValidMessage(const WOscMessage *message, int varNum = 3);


};

/** Method that handles all messages send with /snack, all interaction
 * with snacks will be handeld using this method
 *  needs a Constructor where you define what message this class will listen to
 *  and a virtual Method function which is called when this message is received
 */

class NetworkMethod:
	public NetworkBaseMethod
{
public:
	NetworkMethod(
		WOscContainer* parent,
		NetworkInterface* receiverContext,
		char* adress,
		void (NetworkEvents::*methodUsed)(const WOscMessage *)//, const WOscTimeTag& , const TheNetReturnAddress*) //WOscMessage *, WOscTimeTag& , TheNetReturnAddress*
		);
	virtual void Method(
		const WOscMessage *message,
		const WOscTimeTag& when,
		const TheNetReturnAddress* networkReturnAddress);
	void(NetworkEvents::*mEvent)(const WOscMessage *);//,const WOscTimeTag& ,const TheNetReturnAddress*); //WOscMessage *, WOscTimeTag& , TheNetReturnAddress*
	NetworkEvents mEvents;

	
private :
	bool mDoOwnOSC;
	struct in_addr mLocalAdress;
};

} // namespace ei4

#endif
